module.exports = function createSocket (server) {
  const io = require('socket.io')(server, {
    cors: true
  });

  io.on('connection', function (socket) {
    console.log('服务器连接成功 ');
    socket.emit('news', { hello: 'world' });
  
    socket.on('my other event', function (data) {
      console.log(data);
    });
  });
}